//
//  MVVMDemoViewController.m
//  DebugDemo
//
//  Created by XFB on 2019/1/7.
//  Copyright © 2019年 ZhouCheng. All rights reserved.
//

#import "MVVMDemoViewController.h"
#import "MVVMDemo2ViewController.h"
#import "AnimationViewModel.h"

#import "UserViewModel.h"

@interface MVVMDemoViewController ()

@property (nonatomic, strong) UILabel *userNameLabel;

@end

@implementation MVVMDemoViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    
    self.userNameLabel = [[UILabel alloc] init];
    self.userNameLabel.frame = CGRectMake(20, NavBarHeight + 30, ScreenW-40, 40);
    self.userNameLabel.font = [UIFont systemFontOfSize:16];
    self.userNameLabel.textColor = UIColorFromRGB(0x333333);
    self.userNameLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:self.userNameLabel];
    
    UserViewModel *viewModel = [[UserViewModel alloc] initWithUserName:@"zcmiracle" userID:1 age:25];
    self.userNameLabel.text = viewModel.userName;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    Animation *animation = [[Animation alloc] init];
    animation.name = @"周成，测试Animation";
    AnimationViewModel *viewModel = [[AnimationViewModel alloc] initWithAnimation:animation];

    MVVMDemo2ViewController *vc = [[MVVMDemo2ViewController alloc] init];
    vc.viewModel = viewModel;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
